package myapp.DTO;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

public class SubItemDTO implements Serializable{
	public int id;
	public String name;
	public int serviceId;
	public String tags;
	public String details;
    
    //Date format: yyyy-mm-dd
	public String dateStart;
	public String dateFinish;

	public SubItemDTO(int id, String name, int serviceId, String tags, String details, String dateStart, String dateFinish){
		this.id = id;
		this.name = name;
		this.serviceId = serviceId;
		this.tags = tags;
		this.details = details;
		this.dateStart = dateStart;
		this.dateFinish = dateFinish;
	}
	
	public JSONObject toJson() throws JSONException{
		JSONObject json = new JSONObject();
		json.put("Name", this.name);
		json.put("ServiceId", this.serviceId);
		json.put("Tags", this.tags);
		json.put("Details", this.details);
		json.put("DateStart", this.dateStart);
		json.put("DateFinish", this.dateFinish);
		return json;
	}
}
